﻿using System;
using Unity.Netcode;
using UnityEngine;

[Serializable]
public class ImproveHealthEffect : IPropEffect
{
    public int num=1;
    public void OnUse(Knight knight)
    {
        if(knight)
        {
            knight.Health+=num;
        }
        else
        {
            Debug.LogError($"target don't contain Knight Component");
        }
    }
}

[CreateAssetMenu(fileName = "ImproveHealthProp", menuName = "SO/Prop/ImproveHealthProp")]
public class ImproveHealthProp : PropData
{
    protected override void Reset()
    {
        Effect ??= new ImproveHealthEffect();
    }
}